<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/pages/templates/template-main.xhtml">
    <ui:define name="head"></ui:define>
	<ui:define name="body">
        <h:form>
			<!--xmlns:t="http://myfaces.apache.org/tomahawk"-->
			<!--<t:saveState id="saveBean" value="#{primeDemo}" />-->
            <p:commandButton action="#{primeDemo.generateData}"
                             value="list"
                             update="cupOfCoffeeList"  />
        </h:form>

        <h:panelGroup id="cupOfCoffeeList">
            <h:form>
                <p:dataTable var="cup" value="#{primeDemo.cupOfCoffeeList}" rendered="#{not empty primeDemo.cupOfCoffeeList}">
                    <p:column>
                        <f:facet name="header">
                            Name
                        </f:facet>

                        <h:outputText value="#{cup.coffeeName}" />
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            Price
                        </f:facet>

                        <h:outputText value="#{cup.coffeePrice}" />
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            Edit
                        </f:facet>


                        <p:commandLink value="work" action="#{primeDemo.cupOfCoffee}" />
                    </p:column>

                </p:dataTable>
            </h:form>
        </h:panelGroup>
	</ui:define>

</ui:composition>